<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>充值 - <?php echo $cfg_webname; ?></title>
<link href="templets/style/css/reset.css" rel="stylesheet" type="text/css">
<link href="templets/style/css/member.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="templets/js/j.js"></script>
<script type="text/javascript" src="templets/js/load.js"></script>
<script type="text/javascript">
function change(radio_oj,aValue){
   for(var i=0;i<radio_oj.length;i++){
        if(radio_oj[i].value==aValue){
            radio_oj[i].checked=true;
            break;
        }
   }
}
function Buysubmit(){
	var v=document.getElementsByName('pid')
	var j=0
	for (var i=0;i<v.length;i++){
	 if(v.item(i).checked){
	   j++
	 }
	}
	if(j<1){
		alert("请选择您要充值的面额！")
		document.f1.money.focus();
		return false;
	}else{
		var radios = document.getElementsByName("pid");
		for(var i=0;i<radios.length;i++){ 
			//判断那个单选按钮为选中状态
			if(radios[i].checked){
				if(radios[i].value==9999){
					if(document.f1.money.value < 5){
						alert("最低充值为5元，请重新输入！");
						document.f1.money.focus();
						return false;
					 }
				}
			}
		}
	}
}
</script>
</head>
<body>

<!--head-->
<?php include(DEDEMEMBER. "/templets/head.htm"); ?>


<div class="main">

<?php include(DEDEMEMBER."/templets/menu.php"); ?> 

<div class="main_right">

<div class="common_title">充值消费</div>

<div class="znxx_class">
<a href="buy.php" class="cur">充值金币</a>
<a href="recharge.php">充值记录</a>
<a href="operation.php">消费记录</a>
</div>
     <div class="htit">
      <!--<ul class="fkfs">
      	<h1>付款方式：</h1>
      	<li class="alp"><label><input type="radio" checked="checked" />支付宝</label></li>
      </ul>-->
     </div> 
	 
     <div class="mb_div2">
         <!--<p style="color: #11C95D;">VIP会员活动：充值VIP享受8折优惠，限时半年！</p>-->
         <!--<p style="color: #11C95D;">首次消费开通VIP用户 9.9元体验一个月VIP 活动限时半年！（每个用户只有一次体验机会喔~）</p>-->
         <!--<p style="color: #11C95D;">活动截止到：<?php echo $end_time ?>&nbsp; </p>-->
         <!--<p id="show" style="color:#11C95D;"></p>-->
      <!--<div class="mb_czfrom2 mb_czfrom2-new"> -->
       <!--<ul class="mb_cz2">-->
        <!--<strong>温馨提示</strong><br />-->
        <!--充值自动加金币，<strong>1元=1金币</strong>，充值以后可以马上下载，充值无使用时间限制，用完为止。-->
       <!--</ul> -->
       <!--<form name="f1" action="buy_action.php" method="post" onsubmit="return Buysubmit();"> -->
        <!--<input type="hidden" name="product" value="card" /> -->
        <!--<ul>-->
          <!--<?php echo $moneycards;?>-->
          <!--<li><label><input name="pid" type="radio" id="radio" value="9999" checked="checked"> 充值 <span class="m-p">&yen;</span><input type="text" name="money" class="tx-shue" value="5" oninput="document.getElementById('webtest').innerHTML=this.value;" onpropertychange="document.getElementById('webtest').innerHTML=this.value;" onclick="change(document.f1.pid,'9999')" />, 可获得 <span class="m-p" id="webtest">5</span> 金币</label>，<span>最少充值5元-->
<!--</span></li>-->
        <!--</ul> -->
		<!--<input class="hysj_button" value="立即充值" type="submit">-->
        <!--<div class="bor-b" style="margin-top:20px;"></div>-->
       <!--</form> -->
      <!--</div> -->
     </div>
        <script type="text/javascript">
        TimeDown("show", "<?php echo $end_time ?>");
        function TimeDown(id, endDateStr) {
            //结束时间
            var endDate = new Date(endDateStr);
            //当前时间
            var nowDate = new Date();
            //相差的总秒数
            var totalSeconds = parseInt((endDate - nowDate) / 1000);
            //天数
            var days = Math.floor(totalSeconds / (60 * 60 * 24));
            //取模（余数）
            var modulo = totalSeconds % (60 * 60 * 24);
            //小时数
            var hours = Math.floor(modulo / (60 * 60));
            modulo = modulo % (60 * 60);
            //分钟
            var minutes = Math.floor(modulo / 60);
            //秒
            var seconds = modulo % 60;
            //输出到页面
            document.getElementById(id).innerHTML = "倒计时:" + days + "天" + hours + "小时" + minutes + "分钟" + seconds + "秒";
            //延迟一秒执行自己
            setTimeout(function () {
                TimeDown(id, endDateStr);
            }, 1000)
        }
    </script>
<form name="f1" action="buy_action.php" method="post">
<input type="hidden" name="product" value="member" />
<ul class="hysj_jiage">
 <?php echo $membertypes?>
</ul>
<input type="hidden" name="pid" id="typeid" value="">
</form>

</div>

</div>

<!--footer-->
<?php include(DEDEMEMBER. "/templets/footer.htm"); ?>

<script>
	//会员升级
	var typeid = document.querySelector('#typeid');
	var divs = document.querySelectorAll('.hysj_jiage li div');
	for(var i=0,len=divs.length;i<len;i++){
		divs[i].onclick = divCLickHandler;
//		divs[i].οnmοuseοver = console.log(i);
	}
	function divCLickHandler(e){
		for(var i=0,len=divs.length;i<len;i++){
			divs[i].className = '';
		}
		this.className = 'cur';
		typeid.value = this.getAttribute('_typeid');
	}
</script>
<script>
	//左边导航
	var as = document.querySelectorAll('.left_menu a');
	var spans = document.querySelectorAll('.left_menu .icons');
	for(var i=0,len=as.length;i<len;i++){
		
		spans[i].clazz = spans[i].className;
		as[i].index = i;
		as[i].onmouseenter = mouseenterHandler;
		as[i].onmouseleave = mouseleaseHandler;
	}
	function mouseenterHandler(e){
		if(!/_h$/.test(spans[this.index].clazz)){
			spans[this.index].className = spans[this.index].clazz + '_h';
		}
	}
	function mouseleaseHandler(e){
		spans[this.index].className = spans[this.index].clazz;
	}
	
	//左右等高布局
	var main_left = document.querySelector('.main_left');
	var main_right = document.querySelector('.main_right');
	if(main_left.offsetHeight<main_right.offsetHeight){
		main_left.style.height = main_right.offsetHeight + 'px';
	}
</script>

</body>
</html>